package com.ssyx.sys.controller;

import com.ssyx.common.result.Result;
import com.ssyx.model.sys.Region;
import com.ssyx.sys.service.RegionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * ClassName:RegionController
 * Description:
 *
 * @Author kay
 * @Create 2024/4/26 16:17
 * @Version 1.0
 */
@Tag(name = "区域管理")
@RestController
@RequestMapping("/admin/sys/region")
//@CrossOrigin
public class RegionController {

    @Autowired
    private RegionService regionService;

    @Operation(summary = "根据关键字获取地区列表")
    @GetMapping("findRegionByKeyword/{keyword}")
    public Result findRegionByKeyword(@PathVariable String keyword){
        List<Region> regionList = regionService.findRegionByKeyword(keyword);
        return Result.ok(regionList);
    }
}
